<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="UTF-8" />
    |
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <ul>
      <li>1</li>
      <li>2</li>
      <li>3</li>
      <li>4</li>
    </ul>
    <script>
      // let arr = [1,2,3,4];
      // console.log(arr);
      // console.log(...arr);
      // console.log(arr[0],arr[1],...arr);
      // console.log([1,2,...arr]);

      // let str = 'abs';
      // console.log(...str);

      // var lis = document.querySelectorAll('ul li');
      // console.log(...lis);

      let obj = {
        a: 123,
        b: 456,
        c: 789,
      };
      console.log(obj);
      console.log( ...obj );// 报错，对象底层没有部署迭代器iterator接口
      console.log({ abc: 666, ...obj }); // {abc: 666, a: 123, b: 456, c: 789}
    </script>
  </body>
</html>
